<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/common.jsp"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
  <head>
   <title>用户管理</title>
   <%@ include file="/common/meta.jsp"%>   
   <link href="<c:url value='/styles/main.css'/>" type="text/css" rel="stylesheet">   
<link href="<c:url value='/widgets/ext/css/ext-all.css'/>" type="text/css" rel="stylesheet">
<script src="<c:url value='/widgets/ext/scripts/ext-base.js'/>" type="text/javascript"></script>
<script src="<c:url value='/widgets/ext/scripts/ext-all.js'/>" type="text/javascript"></script>
<script src="<c:url value='/widgets/ext/scripts/miframe.js'/>" type="text/javascript"></script>
<link href="<c:url value="/widgets/extremecomponents/extremecomponents.css"/>" type="text/css"  rel="stylesheet"/>
<script type="text/javascript" src='<%=contextPath%>/dwr/interface/operatorService.js'></script>
<script type="text/javascript" src='<%=contextPath%>/dwr/engine.js'></script>
<script type="text/javascript" src='<%=contextPath%>/dwr/util.js'></script>
</head>
<script type="text/javascript">
  function addOperator(){  
  	openPop("operator.do?method=add","新增用户信息",480,420);  	
  }
  function editInfo(id){
  	openPop("operator.do?method=edit&id="+id,"编辑用户信息",480,420);
  }
  function editWatch(id){
  	openPop("operator.do?method=watch&id="+id,"查看用户信息",480,420);
  }
  function editDetail(id){
  	openPop("operatorDetail.do?method=edit&id="+id,"用户详细信息",480,420);
  }
  function deleteInfo(id){
  	if(window.confirm("确定要删除记录吗？"))
  	{  		
  		operatorService.deleteById(id,function(reply){ajaxSubmit(reply,"删除成功!","reload");});
  	}else{
  		return false;
  	}
  }
</script>
 <body bgcolor="#F2FEF4">
		<div id="detailheader">
			<img src="<%=request.getContextPath()%>/images/main/main_ban01Dot.png" />
			<div>用户管理</div>
		</div>
		<html:form action="operator.do?method=search" method="get">
			<div id="timecote">	
				<div id="timel"></div>			
				<div id="timem">
					<table cellspacing="5px">
						<tr>
							<td align="left">登陆ID:<html:text property="operatorPo.loginId" /></td>
							<td align="left">用户名称:<html:text property="operatorPo.opName" /></td>
							<td><html:submit styleClass="btn_Xp_Bg0" value="查询" /></td>				
						</tr>
					</table>
				</div>
				<div id="timer"></div>
			</div>
			<div style="text-align:right;padding:5px">
				<input type="button" class="btn_Xp_Bg0" value="新增" onclick="addOperator()"/>
			</div>
			<div id="tbcontent">
				<ec:table items="resultList" var="rs" form="operatorForm"
					action="${pageContext.request.contextPath}/operator.do?method=search"
					title="用户管理" retrieveRowsCallback="limit"
					sortRowsCallback="limit" width="95%">
					<ec:row>
						<ec:column property="0" title=" ">
							<a href="#" onclick="editWatch(<c:out value='${rs.opId}'/>);return false"><img src="<%=request.getContextPath()%>/images/search.gif" /></a>
						</ec:column>
						<ec:column property="1" title="登陆ID">
							<c:out value="${rs.loginId}" />
						</ec:column>
						<ec:column property="2" title="用户名称">
							<c:out value="${rs.opName}" />
						</ec:column>
						<ec:column property="3" title="性别">
						<c:choose>
							<c:when test="${rs.sex==1}">
								<c:out value="男" />
							</c:when>
							<c:when test="${rs.sex==2}">
								<c:out value="女" />
							</c:when>
							<c:otherwise>
								<c:out value="未知" />
							</c:otherwise>
						</c:choose>
						</ec:column>						
						<ec:column property="4" title="手机号">
							<c:out value="${rs.mobile}" />
						</ec:column>
						<ec:column property="5" title="是否在线">
						<c:choose>
							<c:when test="${rs.isOnline==0}">
								<c:out value="否" />
							</c:when>
							<c:otherwise>
								<c:out value="是" />
							</c:otherwise>
						</c:choose>
						</ec:column>
						<ec:column property="6" title="状态">
						<c:choose>
							<c:when test="${rs.status==0}">
								<c:out value="正常" />
							</c:when>
							<c:when test="${rs.status==1}">
								<c:out value="注销" />
							</c:when>
							<c:when test="${rs.status==2}">
								<c:out value="删除" />
							</c:when>
							<c:otherwise>
								<c:out value="不可改变" />
							</c:otherwise>
						</c:choose>
						</ec:column>
						<ec:column property="7" title=" ">
						<c:if test="${rs.status!=9}">
							<a href="#" onclick="editInfo(<c:out value='${rs.opId}'/>);return false">编辑</a>
						</c:if>
						</ec:column>
						<ec:column property="86" title=" ">
							<a href="#" onclick="editDetail('${rs.loginId}');return false">详细信息</a>
						</ec:column>
						<ec:column property="9" title=" ">
						<c:if test="${rs.status!=9}">
							<a href="#" onclick="deleteInfo(<c:out value='${rs.opId}'/>);return false">删除</a>
						</c:if>
						</ec:column>
					</ec:row>
				</ec:table>
			</div>
		</html:form>		
	</body>
</html>
